package com.woniuxy.caradmin.service.impl;

import com.woniuxy.caradmin.entity.pojo.Vehiclefiles;
import com.woniuxy.caradmin.entity.vo.VehiclefilesVo;
import com.woniuxy.caradmin.mapper.VehiclefilesMapper;
import com.woniuxy.caradmin.service.VehiclefilesService;
import com.woniuxy.caradmin.util.Constaint;
import com.woniuxy.caradmin.util.R;
import com.woniuxy.caradmin.util.ResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author womenzu
 * @since 2020-12-07
 */
@Service
public class VehiclefilesServiceImpl implements VehiclefilesService {
    @Autowired
    private VehiclefilesMapper vehiclefilesMapper;
    @Override
    public List<Vehiclefiles> selectVehicleAll() {
        return vehiclefilesMapper.selectVehicleAll();
    }

    @Override
    public Vehiclefiles selecctVehicleById(Integer id) {
        Vehiclefiles vehiclefiles = vehiclefilesMapper.selecctVehicleById(id);
        return vehiclefiles;
    }

    @Override
    public boolean addVehiclefiles(Vehiclefiles vehiclefilesAdd) {
        vehiclefilesMapper.addVehiclefiles(vehiclefilesAdd);
        return true;
    }

    @Override
    public boolean removeVehiclefiles(Integer[] ids) {
        if(ids!=null&&ids.length>0){
            for (Integer id : ids) {
                vehiclefilesMapper.removeVehicleById(id);
            }
        }
        return true;
    }

    @Override
    public List<Vehiclefiles> selectVehiclefilesByUseble() {
        List<Vehiclefiles> vehiclefilesUseble = vehiclefilesMapper.selectVehiclefilesByUseble();
        return vehiclefilesUseble;
    }

    @Override
    public List<Vehiclefiles> selectVehicleByPage(VehiclefilesVo vehiclefilesVo) {
        List<Vehiclefiles> vehiclefilesList = vehiclefilesMapper.selectVehicleByPage(vehiclefilesVo);
        return vehiclefilesList;
    }

    @Override
    public boolean updateVehiclefiles(Vehiclefiles vehiclefiles) {
        vehiclefilesMapper.updateVehiclefiles(vehiclefiles);
        return true;
    }

    @Override
    public List<Vehiclefiles> statusCarAll(Integer empLevel) {
        List<Vehiclefiles> vehiclefilesList = vehiclefilesMapper.statusCarAll(empLevel);
        return vehiclefilesList;

    }

    @Override
    public Vehiclefiles selectVehicleId(Integer vehiclefilesid) {
        return null;
    }

    @Override
    public boolean removeVehicleById(Integer id) {
        vehiclefilesMapper.removeVehicleById(id);
        return true;
    }

    @Override
    public boolean updateVehicleById(Integer vehid) {
        vehiclefilesMapper.updateVehicleById(vehid);
        return true;
    }


    @Override
    public boolean updateVehiclefilesImg(Vehiclefiles Vehiclefiles) {
        vehiclefilesMapper.updateVehiclefilesImg(Vehiclefiles);
        return true;
    }
}
